package com.zhuangyuan.cloud.web;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.autoconfigure.domain.EntityScan;
import org.springframework.boot.system.ApplicationHome;
import org.springframework.cache.CacheManager;
import org.springframework.cache.annotation.CacheConfig;
import org.springframework.cache.annotation.Cacheable;
import org.springframework.cache.annotation.EnableCaching;
import org.springframework.cache.concurrent.ConcurrentMapCacheManager;
import org.springframework.cache.interceptor.CacheResolver;
import org.springframework.cache.interceptor.SimpleCacheResolver;
import org.springframework.cache.support.SimpleCacheManager;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.data.jpa.repository.config.EnableJpaRepositories;

import java.io.File;

/**
 * Created by 10191042 on 2019-09-20.
 */
@SpringBootApplication
@ComponentScan(basePackages = {"com.zhuangyuan"})
@EnableJpaRepositories(basePackages = "com.zhuangyuan.cloud.data")
@EntityScan(basePackages = "com.zhuangyuan.cloud.data")
@EnableCaching
public class HzyWebApp {
    private static Logger logger = LoggerFactory.getLogger(HzyWebApp.class);

    public static void main(String[] args) {
        logger.info("HZY Cloud application starting");
        SpringApplication.run(HzyWebApp.class,args);
    }


    private static ApplicationHome home = new ApplicationHome(HzyWebApp.class);

    public static File getHomePath(){
        return home.getDir();
    }

}
